import java.awt.image.BufferedImage;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;

import javax.imageio.ImageIO;


import com.qq.spirit.HttpUtil;
import com.qq.spirit.image.OCR;

public class Test4
{
	

	public static void main(String[] args)
	{
		try
		{
			Map<String,String> m = new ConcurrentHashMap<String,String>();
			m.put("1","1");
			m.put("2","1");
			m.put("3","1");
			m.put("4","1");
			m.put("5","1");
			m.put("6","1");
			m.put("7","1");
			m.put("8","1");
			m.put("9","1");
			m.put("10","1");
			Iterator<String> ite = m.keySet().iterator();
			new Thread(new TR(ite,m)).start();
			m.put("2","12");
		} catch (Exception e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
}
class TR implements Runnable
{
	Iterator<String> ite = null;
	Map<String,String> m = null;
	public TR(Iterator<String> it,Map<String,String> m)
	{
		this.ite = it;
		this.m = m;
	}
	
	public void run()
	{
		while(ite.hasNext())
		{
			String k = ite.next();
			System.out.println(k+"\t"+m.get(k));
			try
			{
				TimeUnit.SECONDS.sleep(2);
			} catch (InterruptedException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}